package com.xinyue.game.client.command;

import com.xinyue.game.messages.ChatRequest;
import com.xinyue.game.messages.LoginRequest;
import org.springframework.shell.standard.ShellComponent;
import org.springframework.shell.standard.ShellMethod;

/**
 * @author 王广帅
 * @date 2021年01月27日 10:50 下午
 */
@ShellComponent
public class UserCommand {
    @ShellMethod("登陆账号：login username password")
    public void login(String username, String password) {
        LoginRequest request = new LoginRequest();
        request.setUsername(username);
        request.setPassword(password);
        GameClientNetworkCommand.sendMessage(request);
    }

    @ShellMethod("发送世界聊天")
    public void sendWorldChat(String message){
        ChatRequest chatRequest = new ChatRequest();
        chatRequest.setChatType(1);
        chatRequest.setMessage(message);
        GameClientNetworkCommand.sendMessage(chatRequest);
    }
}
